package com.huarui.purchaseOrder.action;

import java.util.Map;

import org.ewaf.framework.action.BaseAction;

import com.huarui.purchaseOrder.service.PurchaseOrderService;

public class PurchaseDeleteAction extends BaseAction{

	public static final String MESS = "mess";
	private static final long serialVersionUID = 1412553812990856008L;

//	private Logger logger = Logger.getLogger(PurchaseDeleteAction.class);
	private PurchaseOrderService purchaseOrderService;
	private Integer ordersId;
	private Map<String, Object> mesMap;
	
	

	public Integer getOrdersId() {
		return ordersId;
	}

	public void setOrdersId(Integer ordersId) {
		this.ordersId = ordersId;
	}

	public Map<String, Object> getMesMap() {
		return mesMap;
	}

	public void setMesMap(Map<String, Object> mesMap) {
		this.mesMap = mesMap;
	}

	public void setPurchaseOrderService(PurchaseOrderService purchaseOrderService) {
		this.purchaseOrderService = purchaseOrderService;
	}

	private String deletePurAndDetails() {
		mesMap = purchaseOrderService.deletePurchaseAndDetails(ordersId);
		return MESS;
	}
	
	/**
	 * 删除在线订单
	 * @return
	 */
	public String deleteOnlinePurAndDetails() {
		return this.deletePurAndDetails();
	}
	
	/**
	 * 删除非在线订单
	 * @return
	 */
	public String deleteNotOnlinePurAndDetails() {
		return this.deletePurAndDetails();
	}
	
}
